/*
 * @Author: CoderLPF
 * @Date: 2020-03-17 10:10:27
 * @LastEditTime: 2020-04-20 20:26:57
 * @LastEditors: CoderLPF
 * @Description: 
 * @FilePath: \fzx-system-fd\src\store\index.js
 */
import Vue from 'vue';
import Vuex from 'vuex';
import m_user from './user';
import m_menu from './menu';
import persistedState from 'vuex-persistedstate';

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        projectInfo: {
            projectName: ''
        },
        dict: {
            tenders: [],
            prolist: [],
            majors: []
        }
    },
    mutations: {
        setProjecInfo(state, info) {
            state.projectInfo = info;
        },
        reset(state) {
            state.projectInfo = {};
        },
        dictTenders(state, data) {
            state.dict.tenders = data;
        },
        dictMajors(state, data) {
            state.dict.majors = data;
        }
    },
    actions: {},
    modules: {
        m_user,
        m_menu
    },

    plugins: [persistedState({ storage: window.sessionStorage })]

    // plugins: [persistedState()]
});